import express from 'express';
import * as generatePictureController from '../generatePicture/generatePicture.controller';
import { validateLoginData, authGuard, userGuard } from '../auth/auth.middleware';

const router = express.Router();

/**
 * 制作分享图
 */
router.post('/generatePicture', generatePictureController.picture);







/**
 * 获取内容
 */
router.get('/secondHand', userGuard, generatePictureController.index);

/**
 * 获取内容(按 ID)
 */
router.get('/secondHand/:postId', userGuard, generatePictureController.secondHandDetail);

/**
 * 创建内容
 */
router.post('/secondHand', authGuard, generatePictureController.store);

/**
 * 更新内容
 */
router.patch('/secondHand/:postId', authGuard, generatePictureController.update);

/**
 * 删除内容
 */
router.post('/secondHandDestroy', authGuard, generatePictureController.destroy);


/**
 * 导出路由
 */
export default router;
